﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace ChuongtrinhTracnghiem.Model
{
    class Laydulieu
    {
        public Laydulieu()
        {
            Model.Ketnoi.Thuchienketnoi();
        }
        public DataTable Dulieu(string str, string bang)
        {
            try
            {
                DataSet ds = new DataSet();
                SqlCommand cmd = new SqlCommand(str, Ketnoi.con);
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                da.Fill(ds, bang);
                return ds.Tables[0];
            }
            catch { return null; }
        }

    }

}
